/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.mop.dinnerbook.bean;

import java.util.Comparator;

/**
 *
 * @author Huge Laurie
 */
public class ExportComparator implements Comparator<ExportBean>{

    public int compare(ExportBean bean1, ExportBean bean2) {
        if(!bean1.getDate().equals(bean2.getDate())){
            return bean1.getDate().compareTo(bean2.getDate());
        }
        if(bean1.getFid()!=bean2.getFid()){
            return bean1.getFid() - (bean2.getFid());
        }
        if(bean1.getPid() != bean2.getPid()){
            return bean1.getPid() - bean2.getPid();
        }
        if(bean1.getDid() != bean2.getDid()){
            return bean1.getDid() - bean2.getDid();
        }
        if(bean1.getMid() != bean2.getMid()){
            return bean1.getMid() - bean2.getMid();
        }
        return 0;
    }

}
